package ch.fusun.baron.player.api;

import java.util.Map;

import ch.fusun.baron.core.datastructures.MirrorMap;
import ch.fusun.baron.core.injection.Inject;
import ch.fusun.baron.data.DataUpdate;
import ch.fusun.baron.player.Player;

/**
 * Updates the {@link MarriageService}
 */
public class MarriageUpdate implements DataUpdate {

    @Inject
    private transient MarriageService service;

    private MirrorMap<Player> marriage;

    private Map<Player, Player> marriageProposals;

    /**
     * Kryo constructor
     */
    public MarriageUpdate() {
        // Do nothing
    }

    /**
     * @param marriage
     *            The marriage status
     * @param marriageProposals
     */
    public MarriageUpdate(MirrorMap<Player> marriage,
            Map<Player, Player> marriageProposals) {
        this.marriage = marriage;
        this.marriageProposals = marriageProposals;
    }

    @Override
    public void update() {
        service.setMarriageStatus(marriage, marriageProposals);
    }

}
